package com.spt.springbootzhsx.entity.data;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class FloatData implements Comparable{
    String name;
    Float value;


    @Override
    public int compareTo(Object o) {
        if(o instanceof FloatData){
            if(this.getValue()<((FloatData) o).getValue())return 1;
            else if(this.getValue()>((FloatData) o).getValue())return -1;
            else return 0;
        }
        throw new RuntimeException("对象错误异常");
    }
}
